package com.zhsm.fuxi.utils;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Base64;

import java.io.File;
import java.io.FileOutputStream;

public class Base64Utils {

    // 解密  
    public static Bitmap getFromBase64(String str) {
        File desFile = new File("/storage/emulated/0/pimsecure_debug_1.txt");
        FileOutputStream fos = null;
        byte[] decodeBytes = Base64.decode(str, Base64.DEFAULT);
        try {
            fos = new FileOutputStream(desFile);
            fos.write(decodeBytes);
            fos.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return BitmapFactory.decodeByteArray(decodeBytes, 0, decodeBytes.length);
    }
}